<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style>
        .red{
            border:5px solid red; 
        }
        .yellow{
            border:5px solid yellow;
        }
    </style>
</head>
<body>
    <div id="app">
        <img :class="isState?'red':'yellow'"
        @click="handleClick" 
        :src="imgUrl" alt="" >
    </div>
    <script>
        new  Vue({
            el:"#app",
            data:{
                isState:true,
                imgUrl:"images/img.jpg"
            },
            methods:{
                handleClick(){
                    this.isState = !this.isState
                }
            }
        })
    </script>
</body>
</html>